#!/usr/bin/env node

'use strict';


var path = require('path');
var write = require('hy5b-write');


var src = 'C:\\Users\\ubus\\workspace\\repository\\ubus-root\\services\\webservice\\src\\main\\webapp\\WEB-INF\\weixin';
var argvs = process.argv;
var uri = argvs[2];
if (!uri) {
  console.log('usage: ', argvs[1], ' name');
  return;
}
var f1 = write(path.resolve(src, uri + '.html'), true);

f1.write('<!DOCTYPE html>\r\n');
f1.write('<html lang="en">\r\n');
f1.write(' \r\n');
f1.write('<head>\r\n');
f1.write('  <meta charset="UTF-8">\r\n');
f1.write('  <meta id="viewport" name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />\r\n');
f1.write('  <meta content="yes" name="apple-mobile-web-app-capable" />\r\n');
f1.write('  <meta content="black" name="apple-mobile-web-app-status-bar-style" />\r\n');
f1.write('  <meta content="telephone=no" name="format-detection" />\r\n');
f1.write('  <meta content="email=no" name="format-detection" />\r\n');
f1.write('  <title>前端工程师</title>\r\n');
f1.write('  <link rel="stylesheet" href="css/reset.css" type="text/css" />\r\n');
f1.write('  <link rel="stylesheet" href="css/common.css" type="text/css" />\r\n');
f1.write('  <link rel="stylesheet" href="css/'+uri+'.css" type="text/css" />\r\n');
f1.write('</head>\r\n');
f1.write(' \r\n');
f1.write('<body>\r\n');
f1.write(' \r\n');
f1.write('  <script type="text/javascript" src="js/lib/require/require.min.js"></script>\r\n');
f1.write('  <script type="text/javascript" src="js/app/'+uri+'.js"></script>\r\n');
f1.write('</body>\r\n');
f1.write(' \r\n');
f1.write('</html>\r\n');

var f2 = write(path.resolve(src, 'js/app/' + uri + '.js'), true);

f2.write('require(["common", "$", "serviceUrl"], function(util, $, serviceUrl) {\r\n');

f2.write('});\r\n');


var f3 = write(path.resolve(src, 'css/' + uri + '.css'), true);

f3.write('');